package com.inspur.cmis.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.inspur.cmis.mapper.UserMapper;
import com.inspur.cmis.pojo.User;
import com.inspur.cmis.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UserMapper userMapper;
	

	@Override
	public User getUser(User user) {
		return userMapper.getUser(user);
	}

    /**
     * 检索用户信息列表
     */
	@Override
	public List<User> getUserInfoList(Map<String, String> map) {
		return userMapper.getUserInfoList(map);
	}

	/**
	 * 批量删除
	 */
	@Override
	public void deleteUsers(int[] ids) {
		userMapper.deleteUsers(ids);
	}

	/**
	 * 添加新用户
	 */
	@Override
	public void addUser(User user) {
		userMapper.addUser(user);
	}
	
	@Override
	public List<User> getUserByCname(String cname) {
		List<User> userList=userMapper.getUserByCname(cname);
		return userList;
	}

	/**
	 * 根据用户编号查询用户信息
	 */
	@Override
	public User getUserById(int id) {
		return userMapper.getUserById(id);
	}

	@Override
	public void updateUser(User user) {
		userMapper.updateUser(user);
	}

}
